package com.neusoft.lohas.modules.job.impl;

import java.util.Date;

import com.neusoft.lohas.common.utils.DateUtils;
import com.neusoft.lohas.modules.job.base.BaseTask;
import com.neusoft.lohas.modules.job.base.JobException;
import com.neusoft.lohas.modules.shop.service.ShopService;

public class OrderJobImpl extends BaseTask {
	
	private ShopService shopService;
	
	public ShopService getShopService() {
		return shopService;
	}

	public void setShopService(ShopService shopService) {
		this.shopService = shopService;
	}

	@Override
	public void work() throws JobException{
		System.out.println("excute date: "+DateUtils.formatDate(new Date(), DateUtils.parsePatterns[1]));
		boolean isSuccess = false;
		int num = shopService.updateOrderStatusByTimer();
		System.out.println("excute order num: "+num);
		isSuccess = true;
		System.out.println(String.format("Finish runing order job task, result flag is %b", isSuccess));
	}

}
